#include <memory>

#include <iostream>
using std::cout;
using std::endl;

class Y
{
public:
	Y(int x = 0)
	{
		m_flag = x;
	}
	
	void Ping()
	{
		cout << "Y" << m_flag << endl;
	}
	
private:
	int m_flag;
};

int main()
{
	Y* py = new Y(1);
	std::auto_ptr<Y> autopy(py);
	Y* py2 = new Y(2);
	//std::auto_ptr<Y> autopy2(py2);
	
	autopy.reset(py2);
	delete py;
	
	//autopy->Ping();
	
	return 0;
}
